
import {Base} from '../../utils/util.js';

class Home extends Base{

    constructor(){
      super()
    }


    getBanner(id,callBack){
      // wx.request({
      //  url: 'http://luyiran.com/api/v1/banner/getBanner/'+id, //仅为示例，并非真实的接口地址
      //  method :'GET',
      //  success: function (res) {
      //      callBack(res);
      //   }
      // })

      this.request({
        url : 'banner/getBanner/' +id,
        success:function(res){
          callBack && callBack(res);
        }
      })

    }

    getTheme(callBack) {
      this.request({
        url: 'theme?ids=1,2,3',
        success: function (res) {
          callBack && callBack(res);
        }
      })
    }

    getProducts(callBack) {
      this.request({
        url: 'product',
        success: function (res) {
          callBack && callBack(res);
        }
      })
    }


    chooseImg(callBack){
      this.imgUpload({
        success:function(res){
          callBack && callBack(res);
        }
      });
    }


}

export {Home};






